#coding:utf8

from bottle import route, run, static_file
import acceptmail

#静态文件
@route('/static/<filename>')
def server_static(filename):
    return static_file(filename, root='static')

#index
@route('/')
def index():
    strhtml = '''
		<HTML>
		<HEAD>
		    <meta http-equiv="Content-Type" content="text/html; charset=utf8" />
		    <title>Web监视</title>
		    <META  http-equiv="refresh"  content="3">
		    <META  http-equiv="Expires"  content="0">   
		    <META  http-equiv="Pragma"   content="no-cache">   
		</HEAD>
		<body >
		    <img src='/static/monitor.jpg' width="70%"/>刷新中...
		</body>
		</HTML>
		'''
    acceptmail.accept()		#接收邮件大概3s左右
    return strhtml

run(host='localhost', port=8081, debug=True)	#此处可修改host（ip）和port端口（防止和iis冲突）